package com.hspedu.homework;

/**
 * @author DL5O
 * @version 1.0
 */
public class Homework02 {
    public static void main(String[] args) {
        System.out.println("第一件衣服的序号："+Frock.getNexNum());
        System.out.println("第二件衣服的序号："+Frock.getNexNum());
        System.out.println("====验证是否递增====");
        Frock frock = new Frock();
        System.out.println(frock.getSerialNumber());
        Frock frock2 = new Frock();
        System.out.println(frock2.getSerialNumber());
        Frock frock3 = new Frock();
        System.out.println(frock3.getSerialNumber());
    }
}



class Frock{
    private static int currentNum = 100000;
    private int serialNumber;

    public Frock() {
        this.serialNumber = getNexNum();
    }

    public int getSerialNumber() {
        return serialNumber;
    }

    public static int getNexNum(){
        currentNum +=100;
        return currentNum;
    }

}
